using UniversalAdminSystem.Application.PermissionManagement.DTOs;

namespace UniversalAdminSystem.Application.PermissionManagement.Interfaces;

/// <summary>
/// 角色管理应用服务接口
/// 提供角色的创建、查询、更新、删除等业务操作
/// </summary>
public interface IRoleManagementAppService
{
    /// <summary>
    /// 获取所有角色列表
    /// </summary>
    /// <returns>角色列表</returns>
    Task<IEnumerable<RoleDto>> GetAllRolesAsync();

    /// <summary>
    /// 根据ID获取角色
    /// </summary>
    /// <param name="roleId">角色ID</param>
    /// <returns>角色信息</returns>
    Task<RoleDto?> GetRoleByIdAsync(Guid roleId);

    /// <summary>
    /// 创建新角色
    /// </summary>
    /// <param name="createDto">角色创建数据传输对象</param>
    /// <returns>创建的角色信息</returns>
    Task<RoleDto> CreateRoleAsync(RoleCreateDto createDto);

    /// <summary>
    /// 更新角色信息
    /// </summary>
    /// <param name="roleId">角色ID</param>
    /// <param name="updateDto">角色更新数据传输对象</param>
    /// <returns>更新后的角色信息</returns>
    Task<RoleDto> UpdateRoleAsync(Guid roleId, RoleUpdateDto updateDto);

    /// <summary>
    /// 删除角色
    /// </summary>
    /// <param name="roleId">角色ID</param>
    /// <returns>删除操作结果</returns>
    Task DeleteRoleAsync(Guid roleId);

    /// <summary>
    /// 为角色分配权限
    /// </summary>
    /// <param name="roleId">角色ID</param>
    /// <param name="permissionIds">权限ID列表</param>
    /// <returns>分配操作结果</returns>
    Task AssignPermissionsToRoleAsync(Guid roleId, IEnumerable<Guid> permissionIds);

    /// <summary>
    /// 移除角色的权限
    /// </summary>
    /// <param name="roleId">角色ID</param>
    /// <param name="permissionIds">权限ID列表</param>
    /// <returns>移除操作结果</returns>
    Task RemovePermissionsFromRoleAsync(Guid roleId, IEnumerable<Guid> permissionIds);

    /// <summary>
    /// 获取角色的所有权限
    /// </summary>
    /// <param name="roleId">角色ID</param>
    /// <returns>权限列表</returns>
    Task<IEnumerable<PermissionDto>> GetRolePermissionsAsync(Guid roleId);
} 